package com.wan37.logic.handler;


import com.google.protobuf.Message;
import com.wan37.logic.component.Worker;
import com.wan37.logic.domain.vo.MessageVO;
import io.netty.channel.ChannelHandlerContext;

/**
 * 消息处理器的抽象父类.
 * 所有的消息处理器都应该继承这个父类.
 *
 * @author : luoyong
 * @date : 2020-05-28 09:48
 */
public abstract class MsgHandler implements WorkerHandler {

    public MessageVO messageVO;

    /**
     * MsgHandler构造函数
     *
     * @param messageVO
     */
    public MsgHandler(MessageVO messageVO) {
        this.messageVO = messageVO;
    }

    /**
     * 执行消息处理.
     *
     * @param worker
     * @throws Exception
     */
    @Override
    public abstract void execute(Worker worker) throws Exception;

}
